﻿using ChurchDiary.BLL;
using ChurchDiary.TableEntity;
using ChurchWebsite.Controllers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace ChurchWebsite.Areas.Admin.Controllers
{
    public class OrganizationJobtitleController : BaseController
    {
        //
        // GET: /Admin/OrganizationJobtitle/

        public ActionResult Index()
        {
            return View();
        }

        public JsonResult GetJobTitles(int dataId)
        {
            return Json(new BLL_Shared().GetJobTitles(dataId), JsonRequestBehavior.AllowGet);
        }

        public JsonResult GetChurchesByZone(Guid dataId)
        {
            return Json(new BLL_Church().GetChurches(dataId), JsonRequestBehavior.AllowGet);
        }

        public JsonResult GetChurchWorkerStatus()
        {
            return Json(new BLL_ChurchWorker().GetChurchWorkerStatus(), JsonRequestBehavior.AllowGet);
        }

        public JsonResult GetChurchWorkerAll()
        {
            return Json(new BLL_ChurchWorker().GetChurchWorker(), JsonRequestBehavior.AllowGet);
        }

        public JsonResult AddChurchWorkerJobtitle(EntityChurchWorkerJobtitle Jobtitle)
        {
            return Json(new BLL_ChurchWorker().InsertChurchWorkerJobtitle(Jobtitle), JsonRequestBehavior.AllowGet);
        }

        public JsonResult GetChurchWorkerJobtitle(int PageNo, string SearchKey, string Sort, string SortMode, int PerPage)
        {
            BLL_ChurchWorker CW = new BLL_ChurchWorker();
            return Json(CW.GetChurchWorkerJobtitle(PageNo, SearchKey, Sort, SortMode, PerPage), JsonRequestBehavior.AllowGet);
        }
    }
}
